// pages/user/aboutUs/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  handlerPhoneTap(e) {
    const {phone} = e.currentTarget.dataset
    if (!phone)return
    wx.showActionSheet({
      itemList: ['呼叫', '复制'],
      itemColor: '#007AFF',
      success(res) {
        if (res.tapIndex === 1) {
          wx.setClipboardData({
            data: phone,
            success() {
             wx.showToast({
              title: '联系电话复制成功',
              icon: 'none'
             })
            }
          })
        } else if (res.tapIndex === 0) {
          wx.makePhoneCall({
            phoneNumber: phone 
          })
        }
      }
    })
  },


  handlerCopyValue(e) {
    const {value,filed} = e.currentTarget.dataset
    if (!value)return
    wx.setClipboardData({
      data: value,
      success() {
       wx.showToast({
        title: `${filed||''}复制成功`,
        icon: 'none'
       })
      }
    })
  },

  
  onPullDownRefresh() {
    setTimeout(() => {
      wx.stopPullDownRefresh()
    }, 2000)
  },

  onShareAppMessage() {

  }
})